<!--首页-->
<template>
  <div class="home">
    <el-button v-for="item in configRoutes" :key="item.name" @click="openUrl(item)">{{ item.meta.title }}</el-button>
  </div>
</template>

<script setup>
import { configRoutes } from "@/router/index.js";
import { useRouter } from "vue-router";
const router = useRouter();
/**
 * 打开新页面
 * @param item
 */
const openUrl = item => {
  const url = router.resolve(item.name).href;
  window.open(url);
};
</script>
<style scoped>
.home {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid pink;
  padding: 10px;
}
</style>
<style>
.home {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid pink;
  padding: 10px;
}
</style>
<style scoped lang="less">
.home {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid pink;
  padding: 10px;
}
</style>
